/**
 * Copyright (C), 2019-2022, 宇信融汇
 * FileName: LambdaDemo01
 * Author:   666
 * Date:     2022/1/16 22:27
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 666           修改时间           版本号              描述
 */
package com.lamdbademo;

import javax.swing.*;
import java.util.Arrays;

/**
 * @Classname LambdaDemo01
 * @Description TODO
 * @Date 2022/1/16 22:27
 * @Created by 666
 */
public class LambdaDemo01 {
    public static void main(String[] args) {
        Integer[] arr = {33, 22, 55, 33, 62};
//        Arrays.sort(arr, new Comparator<Integer>() {
//            @Override
//            public int compare(Integer o1, Integer o2) {
//                return o2-o1;
//            }
//        });
        Arrays.sort(arr, (Integer o1, Integer o2) -> {
            return o2 - o1;
        });
        System.out.println(Arrays.toString(arr));

        System.out.println("---------------------");
        JFrame win = new JFrame("窗口");
        JButton btn = new JButton("登录");
        win.add(btn);
//        btn.addActionListener(new ActionListener() {
//            @Override
//            public void actionPerformed(ActionEvent e) {
//                System.out.println("123123123");
//            }
//        });
        btn.addActionListener(e ->
            System.out.println("点我了")
        );

        win.setSize(400, 400);
        win.setVisible(true);
    }
}
